resource "google_compute_interconnect_attachment" "<%= ctx[:primary_resource_id] %>" {
  name                     = "<%= ctx[:vars]['interconnect_attachment_name'] %>"
  edge_availability_domain = "AVAILABILITY_DOMAIN_1"
  type                     = "PARTNER"
  router                   = google_compute_router.foobar.id
  mtu                      = 1500
}

resource "google_compute_router" "foobar" {
  name    = "<%= ctx[:vars]['router_name'] %>"
  network = google_compute_network.foobar.name
  bgp {
    asn = 16550
  }
}

resource "google_compute_network" "foobar" {
  name                    = "<%= ctx[:vars]['network_name'] %>"
  auto_create_subnetworks = false
}
